package light.head.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;
/**
 * 归还明细表
 */
@Entity
@Table
public class ReturnItem implements Serializable{
	
	private static final long serialVersionUID = -2293199190078576090L;
	
	
	
	private Integer code;
	private Integer gc;			//物品名称
	private String tag;				//标签
	private String remark;				//备注
	private Integer rc;				//归还信息编号
	private Integer count;
	
	
	private String gn;			//物品名称
	List<ReturnDetail> detailList;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}

	@Column
	public String getTag() {
		return tag;
	}
	@Column
	public Integer getRc() {
		return rc;
	}
	@Column
	public String getRemark() {
		return remark;
	}
	@Column
	public Integer getGc() {
		return gc;
	}
	
	@Formula("(SELECT g.name FROM Goods g WHERE g.code = gc)")
	public String getGn() {
		return gn;
	}
	@Column
	public Integer getCount() {
		return count;
	}
	@Transient
	public List<ReturnDetail> getDetailList() {
		return detailList;
	}
	
	
	

	

	public void setDetailList(List<ReturnDetail> detailList) {
		this.detailList = detailList;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public void setGc(Integer gc) {
		this.gc = gc;
	}
	public void setGn(String gn) {
		this.gn = gn;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setTag(String tag) {
		this.tag = tag;
	}
	public void setRc(Integer rc) {
		this.rc = rc;
	}
}
